
		Imports Acceso_a_Datos.Datos
		Namespace BO
		Partial Public Class tPlanes
# Region "tPlan_x_Empresa"
	private mlistatPlan_x_Empresa As New List (Of tPlan_x_Empresa)
Public Property ListatPlan_x_Empresa As System.Collections.Generic.List(Of tPlan_x_Empresa)
Get
dim mtPlan_x_Empresa As New tPlan_x_Empresa
mlistatPlan_x_Empresa =mtPlan_x_Empresa.TraerFiltradoListOf("IdPlan",Me.IdPlan)
Return mlistatPlan_x_Empresa
End Get
Set
RemoveAllListatPlan_x_Empresa()
If Not (Value Is Nothing) Then
Dim otPlan_x_Empresa As tPlan_x_Empresa
	For Each otPlan_x_Empresa in Value
		AddListatPlan_x_Empresa(otPlan_x_Empresa)
	Next
End If
End Set
End Property


		
		
	   Public Sub AddListatPlan_x_Empresa(newtPlan_x_Empresa As tPlan_x_Empresa)
	If (mlistatPlan_x_Empresa Is Nothing) Then
		mlistatPlan_x_Empresa = new System.Collections.Generic.List(Of tPlan_x_Empresa)
	End If
	If Not mlistatPlan_x_Empresa.Contains(newtPlan_x_Empresa) Then
		mlistatPlan_x_Empresa.Add(newtPlan_x_Empresa)
		newtPlan_x_Empresa.tPlanes = Me
	End If
End Sub

	   
	   
	   
	   Public Sub RemoveListatPlan_x_Empresa(oldtPlan_x_Empresa As tPlan_x_Empresa)
	If (mlistatPlan_x_Empresa.Contains(oldtPlan_x_Empresa)) Then
		mlistatPlan_x_Empresa.Remove(oldtPlan_x_Empresa)
		oldtPlan_x_Empresa.tPlanes = Nothing
	End If
End Sub
	
			
			Public Sub RemoveAllListatPlan_x_Empresa()
	If Not (mlistatPlan_x_Empresa Is Nothing)
		Dim tmp_listatPlan_x_Empresa As System.Collections.ArrayList = new System.Collections.ArrayList()
		Dim oldtPlan_x_Empresa As tPlan_x_Empresa
		For Each oldtPlan_x_Empresa in mlistatPlan_x_Empresa
			tmp_listatPlan_x_Empresa.Add(oldtPlan_x_Empresa)
		Next
	mlistatPlan_x_Empresa.Clear()
	For Each oldtPlan_x_Empresa in tmp_listatPlan_x_Empresa
		oldtPlan_x_Empresa = Nothing
	Next
	tmp_listatPlan_x_Empresa.Clear()
	End If
End Sub

# End Region
# Region "tPlan_x_Persona"
	private mlistatPlan_x_Persona As New List (Of tPlan_x_Persona)
Public Property ListatPlan_x_Persona As System.Collections.Generic.List(Of tPlan_x_Persona)
Get
dim mtPlan_x_Persona As New tPlan_x_Persona
mlistatPlan_x_Persona =mtPlan_x_Persona.TraerFiltradoListOf("IdPlan",Me.IdPlan)
Return mlistatPlan_x_Persona
End Get
Set
RemoveAllListatPlan_x_Persona()
If Not (Value Is Nothing) Then
Dim otPlan_x_Persona As tPlan_x_Persona
	For Each otPlan_x_Persona in Value
		AddListatPlan_x_Persona(otPlan_x_Persona)
	Next
End If
End Set
End Property


		
		
	   Public Sub AddListatPlan_x_Persona(newtPlan_x_Persona As tPlan_x_Persona)
	If (mlistatPlan_x_Persona Is Nothing) Then
		mlistatPlan_x_Persona = new System.Collections.Generic.List(Of tPlan_x_Persona)
	End If
	If Not mlistatPlan_x_Persona.Contains(newtPlan_x_Persona) Then
		mlistatPlan_x_Persona.Add(newtPlan_x_Persona)
		newtPlan_x_Persona.tPlanes = Me
	End If
End Sub

	   
	   
	   
	   Public Sub RemoveListatPlan_x_Persona(oldtPlan_x_Persona As tPlan_x_Persona)
	If (mlistatPlan_x_Persona.Contains(oldtPlan_x_Persona)) Then
		mlistatPlan_x_Persona.Remove(oldtPlan_x_Persona)
		oldtPlan_x_Persona.tPlanes = Nothing
	End If
End Sub
	
			
			Public Sub RemoveAllListatPlan_x_Persona()
	If Not (mlistatPlan_x_Persona Is Nothing)
		Dim tmp_listatPlan_x_Persona As System.Collections.ArrayList = new System.Collections.ArrayList()
		Dim oldtPlan_x_Persona As tPlan_x_Persona
		For Each oldtPlan_x_Persona in mlistatPlan_x_Persona
			tmp_listatPlan_x_Persona.Add(oldtPlan_x_Persona)
		Next
	mlistatPlan_x_Persona.Clear()
	For Each oldtPlan_x_Persona in tmp_listatPlan_x_Persona
		oldtPlan_x_Persona = Nothing
	Next
	tmp_listatPlan_x_Persona.Clear()
	End If
End Sub

# End Region


# Region "Lecturas que devuelven listas"
Public Function TraerTodosListOf() As List(Of tPlanes)
            Dim dtDatos As DataTable
            Dim listatPlanes As New List(Of tPlanes)
            Dim param As [String]
            param = (Me.mNombreEntidad + "_SelectAll")
            dtDatos = Me.ServidorDatos.TraerDataTable(param)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtPlanes As New tPlanes
				mtPlanes.IdPlan = CType(dr.Item("IdPlan"),Integer)
				mtPlanes.Traer_objeto()
            	listatPlanes.Add( mtPlanes)
    		Next dr
Return listatPlanes
End Function

Public Function TraerFiltradoListOf(ByVal Filtro As [String], ByVal Args As Object) As List(Of tPlanes)
            Dim dtDatos As DataTable
            Dim param As [String]
            Dim listatPlanes As New List(Of tPlanes)
            param = (Me.mNombreEntidad + "_Tx")
            param = (param + Filtro.ToString)
            dtDatos = Me.ServidorDatos.TraerDataTable(param, Args)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtPlanes As New tPlanes
				mtPlanes.IdPlan = CType(dr.Item("IdPlan"),Integer)
				mtPlanes.Traer_objeto()
            	listatPlanes.Add( mtPlanes)
    		Next dr
Return listatPlanes
End Function

Public Function TraerFiltradoLikeListOf(ByVal Filtro As [String], ByVal Args As Object) As List(Of tPlanes)
            Dim dtDatos As DataTable
            Dim param As [String]
            Dim listatPlanes As New List(Of tPlanes)
            param = (Me.mNombreEntidad + "_TxLike")
            param = (param + Filtro.ToString)
            dtDatos = Me.ServidorDatos.TraerDataTable(param, Args)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtPlanes As New tPlanes
				mtPlanes.IdPlan = CType(dr.Item("IdPlan"),Integer)
				mtPlanes.Traer_objeto()
            	listatPlanes.Add( mtPlanes)
    		Next dr
Return listatPlanes
End Function
# End Region

End Class
End Namespace
